package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * java将流按照读写单位划分为字节流和字符流
 *
 */
public class OSWDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos =new FileOutputStream("osw.txt");
        //OutputStreamWriter继承自字符输出流的Writer
        //通过啊写出的字符转换为字节 规定格式
        OutputStreamWriter osw =new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        osw.write("(๑′ᴗ‵๑)Ｉ Lᵒᵛᵉᵧₒᵤ❤");
        osw.write("爱你！");
        System.out.println("完事");
        osw.close();
    }
}
